using System;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace OpenComposite.Base.Controls
{
	[ToolboxBitmap(typeof(PropertyGrid))]
	public class PropertyGridEx : PropertyGrid
	{
		public PropertyGridEx()
			: base()
		{
			this.ToolStripRenderer = OpenComposite.Base.Static.RENDERER_VS2005;
		}

		protected override object GetService(Type service)
		{
			return base.GetService(service);
		}
		protected override void OnSelectedGridItemChanged(SelectedGridItemChangedEventArgs e)
		{
			base.OnSelectedGridItemChanged(e);
		}
		protected override PropertyTab CreatePropertyTab(Type tabType)
		{
			//if ( tabType == typeof(EventsTab) ) {
			//    ConstructorInfo ctor = tabType.GetConstructor(new Type[] { typeof(IServiceProvider) });
			//    if ( ctor == null ) return null;
			//    object obj = ctor.Invoke(new object[] { this.GetService(typeof(IServiceProvider)) });
			//    return obj as PropertyTab;
			//}
			return null;
		}
		protected override void OnSelectedObjectsChanged(EventArgs e)
		{
			base.OnSelectedObjectsChanged(e);
			//this.PropertyTabs.AddTabType(typeof(EventsTab));
			//this.ShowEventsButton(true);
		}

	}
}
